
function show(){  
    var request1 = prefs.getString("spreadsheet");
    _gel("status").innerHTML = "<a href=\""+request1+"\">Fetch the feed</a>";
    _IG_FetchXmlContent(request1, function (response) {  

        _IG_SetTitle(response.getElementsByTagName("title").item(0).nodeValue);
        var html="<p>"+"</p>";
           var entries = response.getElementsByTagName("entry");
            html+="<table>"; 
           if (entries.length>0) { 
             // For each <food> node, get child nodes.
                html+="<tr>";
                var cells = entries.item(i).childNodes;
                for (var j=0; j < cells.length; j++){
                    var tag = cells.item(j).nodeName;
                    if (tag.substring(0,4)=="gsx:"){
                        html += "<th>"+tag.substring(4)+"</th>";
                    }
                }    
                html+="</tr>";
            }
            for (var i = 0; i < entries.length ; i++) { 
             // For each <food> node, get child nodes.
                html+="<tr>";
                var cells = entries.item(i).childNodes;
                for (var j=0; j < cells.length; j++){
                    var tag = cells.item(j).nodeName;
                    if (tag.substring(0,4)=="gsx:"){
                        var value="";
                        var textNode = cells.item(j).firstChild;
                        if (textNode&&textNode.nodeValue){
                            value = cells.item(j).firstChild.nodeValue;
                        }
                        html += "<td>"+value+"</td>";
                    }
                }    
                html+="</tr>";
            }
            html+="</table>";
        _gel("content").innerHTML = html;
        _gel("status").innerHTML = "<br/><a href=\""+request1+"\">Fetch items</a>";
    },10 );
}

function getElement(element, tagname) {
    return element.getElementsByTagName(tagname).item(0);    
}
/**
* Retrieve the first child element for a given tag.
* This method will only look for direct childs. No grandchilds will be found.
* For some an unknown reason, I didn't get the standard getElementsByTagNameNS 
* to work. If you know how, please substitute and let me know.
* This function should not be use for prefixed nodes. Use getNodeNS instead.
*
* @param {Element} element Some Dom element
* @param {String} tagname The child elements tag name.
* @return {Node}Child element or the String "[<"+tagname+"> null]" or "[<"+tagname+"> not found]". 
*/

function getNode(element, tagname) {
    var nodeList = element.getElementsByTagName(tagname);
    if (nodeList.length>0) {
        if (nodeList.item(0).firstChild!=null) {
            return nodeList.item(0).firstChild.nodeValue;
        }
        else {
            return null;
        }
    }
    return null;
}






